Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Assert-RequiredCommandParameter and Test-AccountRequirePassword #94

Merged
merged 7 commits into from
Dec 30, 2022

Conversation

johlju
Copy link
Member

@johlju johlju commented Dec 29, 2022

Pull Request (PR) description

  • Added private function Assert-RequiredCommandParameter that throws an
    exception if a specified parameter is not assigned a value, and optionally
    throws only if a specific parameter is passed. - Issue #92
  • Added public function Test-AccountRequirePassword that returns true or
    false whether an account need a password to be passed - Issue #93
  • DscResource.Common
    • Updated Visual Studio Code project settings to configure testing for Pester 5.
  • Assert-BoundParameter
    • Now has a new parameter set that calls Assert-RequiredCommandParameter
      which will throw an exception if a specified parameter is not assigned
      a value, and optionally throws only if a specific parameter is passed.
  • Fixed unit tests for Assert-ElevatedUser and Test-IsNumericType so
    the public function is tested correctly using the exported function.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Documentation added/updated in README.md.
  • Comment-based help added/updated for all new/changed functions.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See
    DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju
Copy link
Member Author

johlju commented Dec 29, 2022

See if Assert-RequiredCommandParameter command could be a parameter set of the command Assert-BoundParameter, instead of being a separate command.

@codecov
Copy link

codecov bot commented Dec 29, 2022

Codecov Report

Merging #94 (36f5388) into main (161abe2) will increase coverage by 0%.
The diff coverage is 100%.

Impacted file tree graph

@@        Coverage Diff         @@
##           main   #94   +/-   ##
==================================
  Coverage    91%   91%           
==================================
  Files        29    31    +2     
  Lines       548   568   +20     
==================================
+ Hits        499   519   +20     
  Misses       49    49           
Impacted Files Coverage Δ
source/Private/Assert-RequiredCommandParameter.ps1 100% <100%> (ø)
source/Public/Assert-BoundParameter.ps1 100% <100%> (ø)
source/Public/Test-AccountRequirePassword.ps1 100% <100%> (ø)

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 9 files at r1, 8 of 11 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: 10 of 12 files reviewed, all discussions resolved

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 11 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)

@johlju johlju merged commit 052cfde into dsccommunity:main Dec 30, 2022
@johlju johlju deleted the fix/issue#92-issue#93 branch December 30, 2022 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant